package com.pinyoumei.service;

import java.util.Map;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.pinyoumei.pojo.TbUser;


@RequestMapping("/member")
public interface MemberService {

	@RequestMapping("/testRest")
	public Map<String, Object> testRest();
	
	@RequestMapping("/testJsonString")
	public String testJsonString();
	
	// 使用userId查找用户信息
	@RequestMapping("/findUserById")
	String findUserById(Long userId);
	
	
	/**
	 * 用户注册
	 * RabbitMQ异步发送邮件
	 * @param user
	 * @return
	 */
	@RequestMapping("/register")
	String registerUser(@RequestBody TbUser user);
	
	
	/**
	 * 
	 * 用户登录,Redis实现单点登录
	 * @param request
	 * @param response
	 * @return
	 * 
	 */
	@RequestMapping(value="/login",method=RequestMethod.POST)
	String login(@RequestParam("userName")String userName,@RequestParam("password")String password);
	
	/**
	 * 根据token获取用户
	 * @param toket
	 * @return
	 */
	@RequestMapping(value="/cache",method=RequestMethod.POST)
	String getUserByTokenFromRedis(@RequestParam("token")String token);

}
